package com.swak.test.utils;

import java.util.Scanner;
import java.util.function.Consumer;

/**
 * 获取屏幕的输入，并完成相应的功能
 * 
 * @author DELL
 */
public class Scanners {

	public static void scan(Consumer<String> consumer) {
		Scanner in = new Scanner(System.in);
		boolean scanable = true;
		while (scanable) {
			try {
				String line = in.nextLine();
				consumer.accept(line);
			} catch (Exception e) {
			}
		}
		in.close();
	}
}
